<html lang="en" class=" ext-strict">

<%= stylesheet_link_tag    :'tarea_participantes', :media => "all" %>
<%= stylesheet_link_tag    :'tareas', :media => "print" %>

<!--HEAD-->
<head>

  <title><%=t('.home')%></title>

  <%= render 'layouts/javascript_estilos' %>

  <%= csrf_meta_tags %>

</head>

<%
   @usuName = @usuario.nombre

%>

<!--BODY-->
<body id="ext-gen6" class=" ext-safari has_project_nav " data-spy="scroll" data-target=".subnav" data-offset="50">
<div id="sg_grid_heading_proxy" style="position: absolute; visibility: hidden; cursor: move; border: 2px solid rgb(170, 170, 170); z-index: 999; "></div>
<div id="ygddfdiv" style="position: absolute; visibility: hidden; cursor: move; border: 2px solid rgb(170, 170, 170); z-index: 999; ">
</div>

<!-- Barra de navegacion superior
================================================== -->
<div class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>
      <a class="brand" href="#"><%=t('.home')%>
      </a>
      <div class="nav-collapse collapse">
        <ul class="nav">
          <!--li ><!%= link_to t('.menu3_0'), proyectos_path %></li>
          <!--li><!%= link_to t('.menu3_1'), recursos_path %></li>
          <!--li><!%= link_to t('.config_6'), usuarios_path %></li>
          <!--li><!%= link_to t('.menu3_3'), artefactos_path %></li>
          <!--<li class="divider-vertical"></li>


            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= t('.menu2')%><b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><%= link_to t('.menu2_2'), tipo_productos_path %></li>
               </ul>
              </li>-->
          <!--li class="dropdown active">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= t('.config')%><b class="caret"></b></a>
            <ul class="dropdown-menu">
              <!--  <%= link_to t('.config_1'), rols_path %>
              <!%= link_to t('.config_3'), tipo_recursos_path %>
              <!%= link_to t('.config_5'), tipo_artefactos_path %>
              <!%= link_to t('.config_4'), tipo_plantillas_path %>
              <!--   <%= link_to t('.config_2'), organizacions_path %>
                    <!%= link_to t('.config_0'), depositos_path %>
              <!%= link_to t('.menu3_2'), plantillas_path %>

            </ul>
          </li-->
        </ul>
        <ul class="nav pull-right" style="width: 40%">
          <li class="divider-vertical"></li>
          <div id="user_nav">
            <%= javascript_include_tag :defaults %>

            <script type="text/javascript">
                $(document).ready(function() {
                    $('#user_nivel_acceso').change(function () {
                        var nivel = $("#user_nivel_acceso option:selected").val();
                        if(nivel == "1")
                            document.location = "<%= request.protocol + request.host_with_port %>/proyectos";
                        else if(nivel == 2)
                            document.location = "<%= request.protocol + request.host_with_port %>/proyectos";
                        else
                            document.location = "<%= request.protocol + request.host_with_port %>/tarea_participantes";
                    });
                });
            </script>

            <% if user_signed_in? %>
                <%= current_user.email %>
                <%
                   @usr_roles = RolesUsers.find_all_by_user_id(current_user.id);
                   if(@usr_roles.count() > 1) then
                %>
                    <select id="user_nivel_acceso" name="user_nivel_acceso" style="width: 150px;height: 25px;">
                    <option value="" selected="true"><%= t('change_workspace') %></option>
                      <%
                         @usr_roles.each do |usr_rol|
                      %>
                          <option value="<%= usr_rol.role_id%>">
                            <%= case usr_rol.role_id
                                  when 1
                                    t('admin_workspace')
                                  when 2
                                    t('manager_workspace')
                                  when 3
                                    t('worker_workspace')
                                end
                            %>

                          </option>
                      <%
                         end
                      %>
                    </select>
                <%
                   end
                %>
                <%= link_to t('.sign_out'), destroy_user_session_path, :method => :delete %></span>


            <% else %>
                <%= link_to t('.register'), new_user_registration_path %> or <%= link_to 'Sign in', new_user_session_path %>
            <% end %>
          </div>
          <!--li><a href="#"><%= t('.about')%></a></li>
          <li><a href="#contact"><%= t('.contact')%></a></li-->
        </ul>
      </div>
    </div>
  </div>
</div>

<!--Barra 1 y dos-->
<div id="sg_global_nav" class="">
  <div class="top_bar" id="ext-gen449">
    <div class="nav_item spacer" id="ext-gen448"></div>
  </div>
  <!--Barra 2-->
  <div class="project_nav" id="ext-gen97">
    <div class="project_name"><%= @usuName %></div>
    <!--div class="nav_item <!%= (request.url.include? "overview") ? "selected" : "" %>" id="ext-gen105">
      <div class="button " id="ext-gen106">
        <!--%= link_to t('.overview'), overview_path(1),:class => 'button_link' %><!--a class="button_link" id="overview" href= "<%= request.protocol + request.host_with_port %>/proyectos/<%=1 %>/overview"><%= t('.overview')%></a-->
      <!--/div>
    </div-->
    <!--div class="nav_item <!%= (request.url.include? "configu") ? "selected" : "" %>">
      <div class="button"> <!%= link_to t('.setting'), configu_path(1),:class => 'button_link' %><!--a class="button_link" id="confi" href= "<!%= request.protocol + request.host_with_port %>/proyectos/<!%=1 %>/configu" ><!%= t('.setting')%></a-->
      <!--/div>
    </div-->
    <div class="nav_item spacer"></div>
    <!--div class="nav_item config_project_nav">
      <div class="menu button gear_menu"><span class="menu_text" sg_tip=""> <%= link_to t('.atras'), proyectos_path,:class => 'button_link' %></span>
        <div class="icon arrow_open_dark_small"></div>
      </div>
    </div-->
  </div>
</div>




<!-- Menu y contenido
================================================== -->
<div class="sg_main">

  <div class="sg_page" id="sg_page_1339_1">

    <div class="contents  " id="ext-gen33">

      <%= yield %>

    </div>

  </div>

</div>
<%= yield :modal %>

</body>

</html>

